vm-event: proper vCPU-paused checks at resume
authorCorneliu ZUZU <czuzu@bitdefender.com>
Mon, 4 Jul 2016 10:11:44 +0000 (12:11 +0200)
committerJan Beulich <jbeulich@suse.com>
Mon, 4 Jul 2016 10:11:44 +0000 (12:11 +0200)
commit4481335590f9b585b8dd168f0269e064e7ecbf43
tree5292698317c96d1017768d7f72428a5f5d3417bb
parent2e0dd2f9a56c3fd01ec7557346580ab0b01ab7ac
vm-event: proper vCPU-paused checks at resume

A VM_EVENT_FLAG_VCPU_PAUSED flag in a vm-event response should only be treated
as informative that the toolstack user wants the vm-event subsystem to unpause
the target vCPU, but not be relied upon to decide if the target vCPU is actually
paused.

That being said, this patch does the following:

* Fixes (replaces) the old behavior in vm_event_resume, which relied on
  VM_EVENT_FLAG_VCPU_PAUSED to determine if the target vCPU is paused, by
  actually checking the vCPU vm-event pause-count.

* ASSERTs that the vCPU is paused in vm_event_set_registers and
  vm_event_toggle_singlestep.

* Ignores VM_EVENT_FLAG_DENY @ vm_event_register_write_resume if the target vCPU
  is not paused. Also adjusts comment in public/vm_event.h to reflect that.

Signed-off-by: Corneliu ZUZU <czuzu@bitdefender.com>
Acked-by: Razvan Cojocaru <rcojocaru@bitdefender.com>
Acked-by: Tamas K Lengyel <tamas@tklengyel.com>
xen/arch/x86/vm_event.c
xen/common/vm_event.c
xen/include/public/vm_event.h